home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 May: Tool Chest / Dev.CD May 98 TC.toast / Tool Chest / Development Kits / HyperCard Related / APDA HyperCard Toolkits / HyperCard Video Toolkit 2.0 / HVT #2 / Advanced Material / Video Sources / controlVideo.p < prev    next >
Encoding:
Text File  |  1995-02-07  |  2.7 KB  |  108 lines  |  [TEXT/MPS ]

  1. (*
  2.     controlVideo commandList - Control the videodisc. The commandList is a keyword list that
  3.         specifies the specific commands/configuration to be set:
  4.  
  5.         The valid cmds are:
  6.  
  7.             cmd                                Function
  8.             ———                                ——————
  9.             init or reset                    Reset the player, configure the serial port (the baud rate is set to
  10.                                                 the highest available for the selected player).
  11.  
  12.             eject or reject                Eject the disc from the player.
  13.  
  14.             defaultComm                    Set the default communications parameters for the selected player.
  15.  
  16.             audioOff                        Turn off both audio channels.
  17.             audio1On                        Turn on audio channel 1 only.
  18.             audio2On                        Turn on audio channel 2 only.
  19.             audioOn                            Turn on both audio channels.
  20.  
  21.             pictureOn/pictureOff    Turn on/off the picture.
  22.  
  23.             framesOn/framesOff    Turn on/off the display of frame numbers.
  24.  
  25.             frameMode                    Set player to frame number mode.
  26.             chapterMode                    Set player to chapter number mode.
  27.             timeMode                        Set player to time mode.
  28.  
  29.             <other>                            Any other parameters are passed on to configureSPort. This
  30.                                                 includes port setting and baud rate selection.
  31.  
  32.     To compile and link this file using Macintosh Programmer's Workshop,
  33.  
  34.         pascal -w controlVideo.p
  35.         link -m ENTRYPOINT -o HyperCommands -rt XCMD=8001 -sn Main=controlVideo ∂
  36.             controlVideo.p.o "{MPW}"Libraries:interface.o "{MPW}"PLibraries:PasLib.o
  37.  
  38.     Copyright © 1987,88 Apple Computer, Inc.
  39.  
  40.     9/87 - Initial coding by Harry R. Chesley.
  41.     2/88 - Changed to new interface specification by Harry R. Chesley.
  42. *)
  43.  
  44. {$R-}
  45.  
  46. {$S controlVideo }     { Segment name must be the same as the command name. }
  47.  
  48. unit DummyUnit;
  49.  
  50. interface
  51.  
  52. uses MemTypes, QuickDraw, OSIntf, ToolIntf, HyperXCmd;
  53.  
  54. procedure EntryPoint(paramPtr: XCmdPtr);
  55.     
  56. implementation
  57.  
  58. type
  59.  
  60. Str31 = String[31];
  61.  
  62. procedure controlVideo(paramPtr: XCmdPtr); forward;
  63.  
  64. procedure EntryPoint(paramPtr: XCmdPtr);
  65.  
  66.     begin
  67.         controlVideo(paramPtr);
  68.     end;
  69.  
  70. procedure controlVideo(paramPtr: XCmdPtr);
  71.  
  72.     type
  73.         audioModes = (off,oneOn,twoOn,stereo);
  74.  
  75.     var numberOfParms: integer;
  76.         i: integer;
  77.         typeOfVideo: str255;
  78.         parm: str255;
  79.  
  80.     {$I XCmdGlue.inc}
  81.  
  82.     procedure Fail(errMsg: Str255); { set theResult and quit }
  83.         begin
  84.             paramPtr^.returnValue := PasToZero(errMsg);
  85.             exit(controlVideo);
  86.         end;
  87.  
  88.     {$I VideoUtil.inc}
  89.  
  90.     begin
  91.         numberOfParms := paramPtr^.paramCount;
  92.  
  93.         GetStrGlobal('typeOfVideo',typeOfVideo);
  94.  
  95.         { For each parameter... }
  96.         for i := 1 to numberOfParms do
  97.             begin
  98.                 { Get the parameter. }
  99.                 GetStrParm(i,parm);
  100.                 { Call the selected driver. }
  101.                 if typeOfVideo <> '' then EvalAndDispose(Concat('vidDrvr',typeOfVideo,'("control",',parm,')'))
  102.                 { If there is no selected driver, pass it on to the serial port routines. }
  103.                 else SendCardMessage(Concat('configureSPort ',parm));
  104.             end;
  105.     end;
  106.  
  107. end.
  108.